{extend name="public/base" /}
{block name="pjax_container"}
<?php
    $titleTypeName = '下个月奖扣任务配置编辑';
?>
<style>
 tr>th,
    td {
        text-align: center;
    }

    .btn-group-xs>.btn,
    .btn-xs {
        padding: 5px;
        margin: 0 5px;
    }



    .content-header>.breadcrumb>li {
        color: #999;
    }

    .content-header>.breadcrumb>.active {
        color: #666;
    }

    .content-header {
        height: 51px;

    }

    .btn-primary {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 5px 10px;
    }

    .box-primary {
        border-top-color: #ecf0f5 !important;
        border-top-width: 16px;

    }

    .btn-primary:hover {
        background-color: #1890FF;
        color: #fff;
        border: none;
        opacity: .9;
        border-radius: 6px !important;
    }

    .delete-one {
        background-color: ff4141 !important;
        margin-left: 15px;
        border-radius: 6px;
    }

    .sreachs {
        background-color: #1890FF;
        color: #fff;
        border: none;
        border-radius: 6px !important;
        margin-left: 15px;
        padding: 7px 15px;
    }

    .type_explode {
        color: #fff;
        background-color: #d9534f;
        border-radius: 6px;
        border: none;  
    }
    .nav-tabs-custom{
        margin-top: 16px;
    }

</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>奖扣任务</li>
        <li>奖扣任务配置</li>
        <li class="active">{$titleTypeName}</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" action="/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/{$Think.ACTION_NAME}" onsubmit="return false" >
                <input type="hidden" name="id" value="{$info.id|default=0}" />
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">
                            {include file="form/input_isread" title="任务名称" name="name"/}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">任务类型</label>
                        <div class="col-sm-7">
                            <label class="checkbox-inline"><input type="checkbox" name="type[]" value="1" {if condition="isset($info['is_integral']) && $info['is_integral']==1"}checked{/if} class="minimal"> 奖扣分考核</label>
                            <label class="checkbox-inline"><input type="checkbox" name="type[]" value="2" {if condition="isset($info['is_rate']) && $info['is_rate']==1"}checked{/if} class="minimal"> 奖扣比例</label>
                            <label class="checkbox-inline"><input type="checkbox" name="type[]" value="3" {if condition="isset($info['is_man']) && $info['is_man']==1"}checked{/if} class="minimal"> 奖扣人次考核</label>
                        </div>
                    </div>
                    <div class="integral" {if condition="$info['is_integral']==0"} style="display: none;"{/if}>
                        <span class="col-sm-2 ">奖扣分考核</span><br/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">奖扣分周期</label>
                            <div class="col-sm-7">
                                <select  class="form-control" name="integral_type">
                                    <option value="0" {if condition="$info.integral_type eq 0"}selected{/if}>周任务</option>
                                    <option value="1" {if condition="$info.integral_type eq 1"}selected{/if}>月任务</option>
                                </select>
                            </div>
                        </div>
                        {include file="form/input" title="奖分下限" name="integral_reward"/}
                        {include file="form/input" title="扣分下限" name="integral_deduct"/}
                    </div>
                    <div class="rate" {if condition="$info['is_rate']==0"} style="display: none;"{/if}>
                        <span class="col-sm-2 ">奖扣比例</span><br/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">奖扣周期</label>
                            <div class="col-sm-7" style="line-height: 33px;">
                                月任务
                            </div>
                        </div>
                        {include file="form/input" title="奖扣比例(%)" name="rate"/}
                    </div>
                    <div class="man" {if condition="$info['is_man']==0"} style="display: none;"{/if}>
                        <span class="col-sm-2 ">奖扣人次考核</span><br/>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">奖扣人次周期</label>
                            <div class="col-sm-7">
                                <select  class="form-control" name="man_type">
                                    <option value="1" {if condition="$info.man_type eq 1"}selected{/if}>日任务</option>
                                    <option value="2" {if condition="$info.man_type eq 2"}selected{/if}>周任务</option>
                                    <option value="3" {if condition="$info.man_type eq 3"}selected{/if}>月任务</option>
                                </select>
                            </div>
                        </div>
                        {include file="form/input" title="奖扣人次" name="man_num"/}
                        {include file="form/input" title="未完成人次扣分" name="man_deduct"/}
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; 提交">提交</button>
                            </div>
                        </div>
                    </div>

                </div>
            </form>
        </div>
    </div>
</section>
<script type="application/javascript">
    $(document).ready(function () {
        /*ajax页面加载icheck，有该控件的页面才需要*/
        $(".select2").select2({language:"zh-CN"});

    })
    $('.minimal').on('click',function () {
        var aa = $(this).is(':checked');
        var type = $(this).val();
        if(aa){
            if(type == 1){
                $('.integral').show();
            }else if(type == 2){
                $('.rate').show();
            }else if(type == 3){
                $('.man').show();
            }
        }else{
            if(type == 1){
                $('.integral').hide();
            }else if(type == 2){
                $('.rate').hide();
            }else if(type == 3){
                $('.man').hide();
            }
        }
    });
</script>
{/block}
